import request from '@/utils/request'

// 查询风险单元列表
export function listUnit(query) {
  return request({
    url: '/safe/unit/list',
    method: 'get',
    params: query
  })
}

// 查询风险单元详细
export function getUnit(ruId) {
  return request({
    url: '/safe/unit/' + ruId,
    method: 'get'
  })
}

// 新增风险单元
export function addUnit(data) {
  return request({
    url: '/safe/unit',
    method: 'post',
    data: data
  })
}

// 修改风险单元
export function updateUnit(data) {
  return request({
    url: '/safe/unit',
    method: 'put',
    data: data
  })
}

// 删除风险单元
export function delUnit(ruId) {
  return request({
    url: '/safe/unit/' + ruId,
    method: 'delete'
  })
}

// 导出风险单元
export function exportUnit(query) {
  return request({
    url: '/safe/unit/export',
    method: 'get',
    params: query
  })
}


// 无权限 查看风险单元信息
export function getUnit_common(epId) {
  return request({
    url: '/common/safe/unit/' + epId,
    headers: {
      isToken: false
    },
    method: 'get'
  })
}
